<template>
  <div class="head">
  	<div class="sree">
  		<div class="logo"><img :src="companyLogo"></div>
	    <div class="sreinput"><em class="iconfont" @click="vfun_goodsList">&#xe61b;</em><input v-model="vue_guanjin" @keyup.enter="vfun_goodsList" /></div>
	    <div class="land">
	    	<router-link to="/my" v-if="vue_log">
	    		<em class="iconfont" style="font-size: 24px;">&#xe66a;</em>
	    	</router-link>
	    	<router-link to="/landing" v-else>
	    		<span class="iconfont" style="font-size: 26px">&#xe66a;</span>
	    	</router-link>
	    </div>
  	</div>

  </div>
</template>

<script>
export default {
  name: 'hello',
  data () {
    return {
    	vue_log:true,
      vue_guanjin:'',	//关键字
      companyLogo:'',
    }
  },

  created() {
		this.companylogo();
    },
  methods:{
  	vfun_goodsList(){
  		localStorage.setItem("vue_guanjin",this.vue_guanjin);
  		localStorage.setItem("goodsTags","");
  		this.$router.push({path:"/goodsList"})
  	},
	companylogo(){
		this.axios({
					method: 'GET',
					url: "/v3/portal/pages/appIndex",
					data:{
					}
					}).then((res) => {
						this.companyLogo=res.data.portalWebsiteData.websiteLogoUrl;
					}).catch((err)=>{
		  	});
  	}
  },
  mounted(){
		if (localStorage.getItem("memberCode")!=null) {
			this.vue_log=true;
		}else{
			this.vue_log=false;
		}
	},
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}

ul {
  list-style-type: none;
  padding: 0;
}

.head{
	position: fixed;
	width: 100%;
	top: 0;
	height: 1.2rem;
	background: #333;
	color: #fff;
	z-index: 100;
}
.sree{
	width: 100%;
	display: -webkit-box;
	margin-top: 0.2rem;
}
.sree .sreinput{
	line-height: 0.85rem;
	background: #fff;
	-webkit-box-flex: 1;
	border-radius:100px;
	height: 0.8rem;
	display: -webkit-box;
}
.sreinput input{
	display: block;
	border: 0;
	height: 0.8rem;
	box-sizing: border-box;
	-webkit-box-flex: 1;
	border-radius:100px;
	font-size: 14px;
	text-indent:10px;
}
.sreinput em{
	display: block;
	color: #999;
	font-size: 18px;
	margin-left: 0.2rem;
}
.logo {
	width: 15%;
	padding-left: 3%;
	font-size: 16px;
	margin-right: 0.2rem;
}
.logo img{
	height: 0.8rem;
	width: 100%;
  display: none;

}
.land{
	/*width: 20%;*/
  width: 12%;
  text-align: center;
  font-size: 16px;
  vertical-align: middle;
  line-height: .9rem;

}
.land a{
	color: #fff;
}
</style>
